package top.deepdesigner.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import top.deepdesigner.pojo.DtsUserAccount;
import top.deepdesigner.service.DtsUserAccountService;

import java.util.List;

/**
 * Start up <br/>
 * Created with IntelliJ IDEA. <br/>
 * Project Name: shop_manage <br/>
 * Author: duanruiqing <br/>
 * DateTime: 2022/9/21 星期三 21:56:10 <br/>
 */
@Service
public class DtsUserAccountServiceImpl extends ServiceImpl<BaseMapper<DtsUserAccount>, DtsUserAccount> implements DtsUserAccountService {
  @Override
  public DtsUserAccount getUserAccountById(Integer id, Integer status) {
    //不知道数据表如何设计
    List<DtsUserAccount> list = this.list(new LambdaQueryWrapper<DtsUserAccount>()
        .eq(true, DtsUserAccount::getUserId, id)
        .eq(true, DtsUserAccount::getStatus, status)
        .orderBy(true, false, DtsUserAccount::getModifyTime));
    return list.get(0);
  }
}
